import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class Test2 {
    public String solve (String s, String t) {
        // write code here
        char[] ss = s.toCharArray();
        char[] tt = t.toCharArray();
        int[] sum = new int[ss.length+tt.length];
        for (int i = 0; i < ss.length; i++) {
            for (int j = 0; j < tt.length; j++) {
                sum[i+j+1] += (ss[i]-'0') * (tt[j]-'0');
            }
        }
        StringBuilder ret = new StringBuilder();
        int tmp = 0;
        for (int i = sum.length-1; i >= 0; i--) {
            ret.append((sum[i]+tmp) % 10);
            tmp = (sum[i] + tmp) / 10;
        }
        ret = ret.reverse();
        while (ret.length() > 1 && ret.charAt(0) == '0') {
            ret.deleteCharAt(0);
        }
        return ret.toString();
    }

    public static void main(String[] args) throws ExecutionException, InterruptedException {
//        Test2 t = new Test2();
//        System.out.println(t.solve("12", "12"));
        CompletableFuture<String> future = CompletableFuture.completedFuture("hello!")
                .thenApply(s -> s + "world!");
        System.out.println(future.get());
// 这次调用将被忽略。
        future = future.thenApply(s -> s + "nice!");
        System.out.println(future.get());
    }
}
